﻿#region

using System.Collections.Generic;

#endregion

namespace TvdbLib.Data.Comparer
{
    /// <summary>
    ///     Compare episodes according to their absolute episode number
    /// </summary>
    internal class EpisodeComparerAbsolute : IComparer<TvdbEpisode>
    {
        #region Methods

        public int Compare(TvdbEpisode x, TvdbEpisode y)
        {
            return (x.AbsoluteNumber - y.AbsoluteNumber);
        }

        #endregion Methods
    }

    /// <summary>
    ///     Compare episodes according to their default episode numbers (aired)
    /// </summary>
    internal class EpisodeComparerAired : IComparer<TvdbEpisode>
    {
        #region Methods

        public int Compare(TvdbEpisode x, TvdbEpisode y)
        {
            return x.EpisodeNumber - y.EpisodeNumber;
        }

        #endregion Methods
    }

    /// <summary>
    ///     Compare episodes according to their dvd episode number
    /// </summary>
    internal class EpisodeComparerDvd : IComparer<TvdbEpisode>
    {
        #region Methods

        public int Compare(TvdbEpisode x, TvdbEpisode y)
        {
            return (int) (x.DvdEpisodeNumber - y.DvdEpisodeNumber);
        }

        #endregion Methods
    }
}